﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index_img_list.aspx.cs" Inherits="SF.Ucenter.admin.goods.index_img_list" %>
<%@ Import Namespace="SF.Common" %>

<!DOCTYPE html>
<%--首页图片列表--%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>首页活动图片</title>
    <link href="../../scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../../css/pagination.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery.lazyload.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <style type="text/css">
        .sort {
            display: inline-block;
            padding: 0 3px;
            border: 1px solid #d7d7d7;
            width: 40px;
            height: 20px;
            line-height: 18px;
            color: #666;
            font-size: 12px;
            background: #fff;
            vertical-align: middle;
        }

        .rlist {
            display: block;
            margin: 2px 15px;
            padding: 0;
            color: #666;
            font-size: 12px;
            line-height: 20px;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        .rspan {
            padding: 0;
            color: #666;
            font-size: 12px;
            line-height: 20px;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        h1 a:link, h1 a:visited {
            color: #fff;
            text-decoration: none;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //imgLayout();
            //$(window).resize(function () {
            //    imgLayout();
            //});
            //图片延迟加载
            $(".pic img").lazyload({ load: AutoResizeImage, effect: "fadeIn" });
            //点击图片链接
            $(".pic img").click(function () {
                var linkUrl = $(this).parent().parent().find(".foot a").attr("href");
                if (linkUrl != "") {
                    location.href = linkUrl; //跳转到修改页面
                }
            });
        });
        //排列图文列表
        //function imgLayout() {
        //    var imgWidth = $(".imglist").width();
        //    var lineCount = Math.floor(imgWidth / 222);
        //    var lineNum = imgWidth % 222 / (lineCount - 1);
        //    $(".imglist ul").width(imgWidth + Math.ceil(lineNum));
        //    $(".imglist ul li").css("margin-right", parseFloat(lineNum));
        //}
        //等比例缩放图片大小
        function AutoResizeImage(e, s) {
            var img = new Image();
            img.src = $(this).attr("src")
            var w = img.width;
            var h = img.height;
            var wRatio = w / h;
            if ((220 / wRatio) >= 165) {
                $(this).width(220); $(this).height(220 / wRatio);
            } else {
                $(this).width(165 * wRatio); $(this).height(165);
            }
        }
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
            <a href="../First.aspx" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <span>首页图片列表</span>
        </div>
        <!--/导航栏-->

        <!--工具栏-->
        <div id="floatHead"  class="toolbar-wrap">
            <div class="toolbar">
                <div class="box-wrap">
                    <div class="l-list">
                        <ul class="icon-list">
                            <li><a class="add" href="index_img_edit.aspx?action=<%=DTEnums.ActionEnum.Add %>"><i></i><span>新增</span></a></li>
                            <li>
                                <asp:LinkButton ID="btnSave" runat="server" CssClass="save" OnClick="btnSave_Click"><i></i><span>保存</span></asp:LinkButton></li>
                            <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
                            <li>
                                <asp:LinkButton ID="btnDelete" runat="server" CssClass="del" OnClientClick="return ExePostBack('btnDelete');" OnClick="btnDelete_Click"><i></i><span>删除</span></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton ID="btnOnShelf" runat="server" CssClass="lock"   OnClientClick="return ExePostBack('btnOnShelf');" OnClick="btnOnShelf_Click"><i></i><span>上架</span></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton ID="btnOffShelf" runat="server" CssClass="lock" OnClientClick="return ExePostBack('btnOffShelf');" OnClick="btnOffShelf_Click"><i></i><span>下架</span></asp:LinkButton></li>
                        </ul>
                        <div class="menu-list">
                            <div class="rule-single-select">
                                <asp:DropDownList ID="ddlShelf" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlShelf_SelectedIndexChanged">
                                    <asp:ListItem Value="0">全部</asp:ListItem>
                                    <asp:ListItem Value="1">已上架</asp:ListItem>
                                    <asp:ListItem Value="2">已下架</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                    </div>
                    <div class="r-list">
                        <asp:TextBox ID="txtKeywords" runat="server" CssClass="keyword" />
                        <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn-search" OnClick="btnSearch_Click">查询</asp:LinkButton>
                    </div>
                </div>
            </div>
        </div>
        <!--/工具栏-->

        <!--图片列表-->
        <asp:Repeater ID="rptList2" runat="server" OnItemCommand="rptList_ItemCommand">
            <HeaderTemplate>
                <div class="imglist">
                    <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <div class="details<%#Eval("pics").ToString() != "" ? "" : " nopic"%>">
                        <div class="check">
                            <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" />
                            <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                        </div>
                        <div class="pic">
                            <img src="../skin/default/loadimg.gif" data-original="<%# Eval("pics") %>" /></div>
                        <i class="absbg"></i>


                        <h1><span><a href="index_img_edit.aspx?action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("id")%>"><%#Eval("titles")%></a></span></h1>
                        <div class="rlist">
                            <span>上市时间：<%#Eval("addTime")%></span>
                        </div>
                        <div class="foot">
                            <span class="rspan"><%# Eval("isShow").ToString().Equals("1")?"已上架":"未上架" %></span>
                            <span class="rspan">
                                排序：
                                <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort")%>' CssClass="sort" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" />
                            </span>
                            <a href="index_img_edit.aspx?action=<%#DTEnums.ActionEnum.Edit %>&id=<%#Eval("id")%>" title="编辑" class="edit">编辑</a>
                        </div>
                    </div>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                <%#rptList2.Items.Count == 0 ? "<div align=\"center\" style=\"font-size:12px;line-height:30px;color:#666;\">暂无记录</div>" : ""%>
  </ul>
</div>
            </FooterTemplate>
        </asp:Repeater>
        <!--/图片列表-->

        <!--内容底部-->
        <div class="line20"></div>
        <div class="pagelist">
            <div class="l-btns">
                <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);" OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
            </div>
            <div id="PageContent" runat="server" class="default"></div>
        </div>
        <!--/内容底部-->
    </form>
</body>
</html>

